package com.example.userservice.service;

import com.example.userservice.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Optional;

public interface UserService {

    List<User> getAllUsers();

    Optional<User> getUserById(Long id);

    User createUser(User user);

    User updateUser(Long id, User userDetails);

    void deleteUser(Long id);

    Page<User> getUsersByPage(Pageable pageable);

    List<User> getUsersByName(String name);

    Optional<User> getUserByEmail(String email);

    List<User> getUsersByStatus(String status);

    void deleteUsers(List<Long> ids);

    List<User> getUsersByNameAndEmail(String name, String email);

    List<User> getUsersByRole(String role);

    // 新增统计用户总数接口
    long countAllUsers();

    // 新增按角色统计用户数量接口
    long countUsersByRole(String role);

    void test();
}